function modality(modal) {
    // console.log(modal);

    let str = `
<div class="modal_box">
    <i class="modal_close"></i>
    <span class="modal_box_img"></span>
    <div class="modal_box_title">
        <p class="modal_box_tit_col">账户登录</p>
        <p>扫码登录</p>
    </div>
    <div class="modal_box_cont">
        <div class="modal_box_form  modal_box_modal_show" >
            <label class="entry">
                <span></span>
                <input type="text" placeholder="用户名/手机号/邮箱" class="modal_box_user">
            </label>
            <label class="entry">
                <span></span>
                <input type="password" placeholder="密码" class="modal_box_pow">
            </label>

            <a href="#" class="modal_box_form_forget">忘记密码</a>
            <button type="button" class="modal_box_form_btn">登录</button>
            <p class="modal_box_form_register">还没有源码账号,<a href="#">立即注册</a></p>
        </div>
        <div class="modal_box_sweep">
            <div class="modal_box_code">
                <img src="./images/wechat-white.png" alt="">
                <p>微信扫码登录</p>
                <p>未关注源码科技公众号,请先关注后在登陆</p> 
            </div>
            <p class="modal_box_sweep_p">还没有源码账号,<a href="#">立即注册</a></p>
        </div>
    </div>
</div>`
    // 将这个结构赋给modal
    modal.innerHTML = str
    // 创建点击事件  当我点击的时候关闭模态框
    modal.addEventListener('click', function (e) {
        // console.dir(e.target);
        // 判断我点击的是不是想要的
        if (e.target.className == "modal modal_show") {
            modal.classList.remove('modal_show')
        }

    })
    // 登录方式的跳转
    let modalTitle = document.querySelectorAll('.modal_box_title>p')
    // 获取登录方式的内容
    let mod = document.querySelectorAll('.modal_box_cont>div')
    // 批量注册点击事件
    modalTitle.forEach(function (open, i) {
        open.addEventListener('click', function () {
            // 排他
            modalTitle.forEach(function (open, i) {
                open.classList.remove('modal_box_tit_col')
                mod[i].classList.remove('modal_box_modal_show')
            })
            open.classList.add('modal_box_tit_col')
            mod[i].classList.add('modal_box_modal_show')
        })
    })
    // 点击模态框上面的❌关闭模态框
    let close = document.querySelector('.modal_close')
    close.addEventListener('click', function () {
        modal.classList.remove('modal_show')
    })
    // 表单元素 验证
    // 用户名 user  密码 123456
    // console.log(login);
    let entrys = document.querySelectorAll('.entry input')
    let formBtn=document.querySelector('.modal_box_form_btn')
    formBtn.addEventListener('click',function(){
        if(entrys[0].value==='user'&&entrys[1].value==='123456'){
            setTimeout(function(){
                modal.classList.remove('modal_show')
                login.textContent='user'
                
                // login.disabled=false
                login.disabled=true
                // console.dir(login);
                // console.log(formBtn.textContent);
                
            },500)
           
        }else{
            alert('用户名或密码输入有误')
        }
    })
}







/* <div class="modal">
        
<div class="modal_box">
    <i class="modal_close"></i>
    <span class="modal_box_img"></span>
    <div class="modal_box_title">
        <p class="modal_box_tit_col">账户登录</p>
        <p>扫码登录</p>
    </div>
    <div class="modal_box_cont">
        <div class="modal_box_form  modal_box_modal_show" >
            <label>
                <span></span>
                <input type="text" placeholder="用户名/手机号/邮箱" class="modal_box_user">
            </label>
            <label>
                <span></span>
                <input type="password" placeholder="密码" class="modal_box_pow">
            </label>

            <a href="#" class="modal_box_form_forget">忘记密码</a>
            <button type="button" class="modal_box_form_btn">登录</button>
            <p class="modal_box_form_register">还没有源码账号,<a href="#">立即注册</a></p>
        </div>
        <div class="modal_box_sweep">
            <div class="modal_box_code">
                <img src="./images/wechat-white.png" alt="">
                <p>微信扫码登录</p>
                <p>未关注源码科技公众号,请先关注后在登陆</p> 
            </div>
            <p class="modal_box_sweep_p">还没有源码账号,<a href="#">立即注册</a></p>
        </div>
    </div>
</div>
</div> */